Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: Use virtual terminal processing if available #177

Closed
wants to merge 1 commit into from
Closed

Windows: Use virtual terminal processing if available #177

wants to merge 1 commit into from

Conversation

stephan-gh
Copy link
Contributor

Related to: fusesource/jansi#63. Windows 10 adds native support for ANSI escape codes, although they're only enabled when ENABLE_VIRTUAL_TERMINAL_PROCESSING is set for the output handle.

I was curious how well it's working in Windows 10 and attempted to use it for JLine. After enabling the flag and disabling the AnsiWriter, I wasn't able to find any functional difference between AnsiWriter and the native functionality so it appears to work pretty well. (I tested using Gogo and a custom simple LineReader command line app)

The implementation attempts to set ENABLE_VIRTUAL_TERMINAL_PROCESSING but will still fall back to the AnsiWriter for older Windows versions.


Not sure if we should merge this right away. I wasn't able to find any problems but it wouldn't hurt to do more testing. Considering everything is working fine with the current code, it isn't top-priority either.

Windows 10 added native support for ANSI escape codes. However, that
functionality is hidden behind the ENABLE_VIRTUAL_TERMINAL_PROCESSING
flag that needs to be set manually using the Windows API.

Use the native functionality on Windows 10, but fall back to the
AnsiWriter if setting the flag fails on older Windows versions.
@gnodet
Copy link
Member

gnodet commented Jun 7, 2018

This would allow to support more ANSI sequences that what is provided by Jansi / Jna through the AnsiWriter. An example is the smcup / alternate_screen capability which is supported by this mode: see Console Virtual Terminal Sequences

@gnodet
Copy link
Member

gnodet commented Jun 7, 2018

Superseded by #280

@gnodet gnodet closed this Jun 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants